using System.Windows.Forms;
using GTA;

namespace CustomPeds;

public class ScriptSettings : Script
{
    private static GTA.ScriptSettings CustomPedsIni;

    public static Keys startKey = Keys.O;

    static ScriptSettings()
    {
        try
        {
            CustomPedsIni = GTA.ScriptSettings.Load("scripts\\CustomPeds.ini");
            // 若配置缺失或读取失败，保留默认 Keys.O
            startKey = CustomPedsIni.GetValue("Keys", "start_Key", startKey);
        }
        catch
        {
            startKey = Keys.O;
        }
    }

    public ScriptSettings()
    {
        try
        {
            CustomPedsIni = GTA.ScriptSettings.Load("scripts\\CustomPeds.ini");
            startKey = CustomPedsIni.GetValue("Keys", "start_Key", startKey);
        }
        catch
        {
            // 忽略异常，沿用静态默认值
        }
    }
}


